app.controller('sys_groupViewController', ['$scope', 'httpWrapService', 'dialogs', '$state', '$stateParams', '$location', '$anchorScroll',
            function ($scope, httpWrapService, dialogs, $state, $stateParams, $location, $anchorScroll) {
    $scope.entity = {};
    $scope.id = $stateParams.id;

    if($scope.id) {
    	httpWrapService.post('system/group/view/' + $scope.id + '.do').then(function (res) {
    		$scope.entity = res.data.entity;
    		var roleName = [];
    		for(var i = 0; i < res.data.map.roles.length; i++) {
    			roleName.push(res.data.map.roles[i].name);
    		}
    		$scope.entity.roleNames = roleName.join(',');
   		 });
	}

    $scope.canle = function () {
        // 后退到列表页面
        $state.go('app.system.group.list');
    }
    

}]);